;/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;*  Copyleft (!c) 2004-2005 Div. Nucl. Med., Cyric, Tohoku Univ.    *
;*  Copyleft (!c) 2005-2011 Elseif Laboratory.                      *
;*  elseifkk@users.sf.net                                           *
;*                                                                  *
;*  All Rights Reversed.                                            *
;*                                                                  *
;*                                                                  *
;*  LICENSE AGREEMENT:                                              *
;*                                                                  *
;*  You agree that we don't agree to anything.                      *
;*                                                                  *
;*                                                                  *
;*  DISCLAIMER OF WARRANTIES:                                       *
;*                                                                  *
;*  This software is provided to you "AS IS," and the authors and   *
;*  contributors disclaim any warranty or liability obligations to  *
;*  you of any kind, implied or express, including but not limited  *
;*  to the warranties of merchantability, fitness for a particular  *
;*  purpose, and non-infringement.                                  *
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
section .data 
anahdr_len db \
04,10,18,04,02,01,01,02,02,02,02,02,02,02,02,01, \
01,01,01,01,01,01,01,01,01,01,01,02,02,02,02,04, \
04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,04, \
04,80,24,01,10,10,10,10,10,10,03,04,04,04,04,04, \
04,04,04
%assign num_anahdr_len 67
section .text
global swap_anahdr__
;;; 
swap_anahdr__:
 push edi
 push esi
 push ebx
 %assign _P 4*3
 mov ebx, anahdr_len
 mov esi, [esp+_P+4]
 mov ecx, num_anahdr_len
 xor eax, eax
 .do:
   mov al, byte [ebx]
   cmp al, 2
   jne .next
   mov dx, word [esi]
   bswap edx
   sar edx, 16
   mov word [esi], dx
   jmp .loop
 .next:	
   cmp al, 4
   jne .loop
   mov edx, dword [esi]
   bswap edx
   mov dword [esi], edx
 .loop:	
   add esi, eax
   inc ebx
   dec ecx
   ja .do
 .exit:	
   pop ebx
   pop esi
   pop edi
   ret
